package com.harboursoftware.xstorage.db;

import java.util.List;

import com.harboursoftware.xstorage.XStorageException;
import com.harboursoftware.xstorage.model.XBucket;
import com.harboursoftware.xstorage.model.XUser;

/**
 * <p>
 * 该接口的实现必须是线程安全的
 * </p>
 * 
 * @author Simon Leung
 * @since 0.1
 */
public interface BucketDao {
    public XBucket findBucketByName(String name) throws XStorageException;
    
    public List<XBucket> findBucketsOfUser(XUser user) throws XStorageException;

    public void saveBucket(XBucket bucket) throws XStorageException;

    public void updateBucket(XBucket bucket) throws XStorageException;
    
    public void deleteBucket(XBucket bucket) throws XStorageException;
}
